<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>新闻详情</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 20px;
            background-color: #f5f5f5;
        }
        .news-detail {
            background-color: white;
            padding: 20px;
            border-radius: 8px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
        }
    </style>
</head>
<body>
    <h1 id="news-title">新闻标题</h1>
    <div id="news-content" class="news-detail">
        新闻内容加载中...
    </div>
    <script>
        // 模拟新闻数据
        const newsData = {
            1: {
                title: '新闻标题1',
                content: '新闻内容1...'
            },
            2: {
                title: '新闻标题2',
                content: '新闻内容2...'
            },
            3: {
                title: '新闻标题3',
                content: '新闻内容3...'
            }
        };

        // 获取URL中的新闻ID
        const urlParams = new URLSearchParams(window.location.search);
        const newsId = urlParams.get('id');

        // 显示新闻内容
        if (newsData[newsId]) {
            document.getElementById('news-title').innerText = newsData[newsId].title;
            document.getElementById('news-content').innerText = newsData[newsId].content;
        } else {
            document.getElementById('news-title').innerText = '新闻未找到';
            document.getElementById('news-content').innerText = '抱歉，未找到相关新闻。';
        }
    </script>
</body>
</html>
